package model

type Member struct {
	Id       int    `json:"id"`
	Account  string `json:"account"`
	Password string `json:"password"`
	Mobile   string `json:"mobile"`
	Nickname string `json:"nickname"`
	Balance  string `json:"balance"`
	Ctime    int64  `json:"ctime"`
	Utime    int64  `json:"utime"`
	Token    string `xorm:"-" json:"token"`
}

func MemberAccountLogin(Account string, Password string) bool {
	var member Member
	err := DB.Table("member").
		Where("(account = ? OR mobile = ?) AND password = ?", Account, Account, Password).
		Find(&member).Error
	if err != nil {
		return false
	}
	return true
}
